<?php
require 'conn.php';
//		$admin = $_SESSION['admin'];
//		$userid = $_SESSION['userid'];
//		if (($admin == "") && ($userid == "")) {
//			echo "<h2>请先登陆</h2>";
//		}
//		else
//		{
	$shopid = $_REQUEST['shopid'];	
	
	if ($_REQUEST['deleteid'] != '') {
		$deleteid = $_REQUEST['deleteid'];
		$query = "DELETE FROM comments WHERE comment_id=".$deleteid;
		$result = mysql_query($query);
		$num = mysql_affected_rows();
		if ($num > 0)
		{
			echo "删除成功";
		}
		else 
		{
			echo "<script language=javascript>alert('删除失败'); history.go(-1)</script>";		
		}
	}
	else 
	{
		echo "<script language=javascript>alert('删除失败'); history.go(-1)</script>";
	}
	echo "<br><a href='viewComments.php?shopid=".$shopid."'>返回评论列表</a>";
?>

<?php
//	 }
?>
